<template>
    <div class="layout">
        <Layout>
            <Header>
                <Menu mode="horizontal" theme="dark" active-name="1">
                    <div class="layout-logo"><img src="//s-www.hfjy.com/pc/images/logo.png" /></div>
                    <!-- <div class="layout-logo"><img src="//s-www.hfjy.com/pc/images/logo.png"/></div> -->
                    <div class="layout-nav">
                        <router-link to="/main/addTask">
                            <MenuItem name="1">
                            <Icon type="ios-navigate"></Icon>
                            <span @click='setSecondTile'>添加任务</span>
                            </MenuItem>
                        </router-link>
                        <MenuItem name="2">
                        <Icon type="ios-keypad"></Icon>
                        <span>{{getUserInfo.name}}</span>
                        </MenuItem>
                        <MenuItem name="3">
                        <Icon type="ios-analytics"></Icon>
                        Item 3
                        </MenuItem>
                        <MenuItem name="4">
                        <Icon type="ios-paper"></Icon>
                        退出
                        </MenuItem>
                    </div>
                </Menu>
            </Header>
            <Layout>
                <Sider hide-trigger :style="{background: '#fff'}">
                    <Menu active-name="1-2" theme="light" width="auto" :open-names="['1']">
                        <Submenu name="1">
                            <template slot="title">
                                <Icon type="ios-navigate"></Icon>
                                我的工作台
                            </template>
                            <router-link to="/main/NextDo">
                                <MenuItem name="1-1">即将运行
                                </MenuItem>
                            </router-link>
                            <router-link to="/main/Done">
                                <MenuItem name="1-2"> 已经运行
                                </MenuItem>
                            </router-link>
                            <MenuItem name="3-2">
                                <span @click="increment">Option 2</span>
                            </MenuItem>
                        </Submenu>
                        <Submenu name="2">
                            <template slot="title">
                                <Icon type="ios-stats"></Icon>
                                统计分析
                            </template>
                            <MenuItem name="2-1">Option 1
                            </MenuItem>
                            <MenuItem name="2-2">Option 2
                            </MenuItem>
                        </Submenu>
                        <Submenu name="3">
                            <template slot="title">
                                <Icon type="ios-analytics"></Icon>
                                Item 3
                            </template>
                            <MenuItem name="3-1">Option 1
                            </MenuItem>
                            <MenuItem name="3-2">Option 2
                            </MenuItem>
                        </Submenu>
                    </Menu>
                </Sider>
                <Layout :style="{padding: '24px 24px 24px'}">

                    <Content :style="{padding: '24px', minHeight: '280px', background: '#fff'}">
                        <!-- <NextDo></NextDo> -->
                        <router-view/>
                        <!-- <AddTask></AddTask> -->
                    </Content>
                </Layout>

            </Layout>

        </Layout>
        <Row>
            <Col span="24" style="text-align: center;margin: 10px 0;">数据增长部·海风教育{{count}}
            </Col>
        </Row>
    </div>
</template>
<script>
    import { mapGetters,mapActions} from 'vuex'
    export default {
        data() {
            return {
                currentFirstNavName: '一级导航',
                currentSecondNavName: '二级导航'
            }
        },
        methods: {
            ...mapActions('task',['increment']),
            setSecondTile(event) {
            }
        },
        computed: {
            ...mapGetters('user',['getUserInfo'])
        },
        // getCount() {
        //     console.log(this.getUserInfo)
        //     return this.$store.state.task.count
        //     // return this.$store.state.count
        // }

    }
</script>
<style scoped>
    .layout {
        border: 1px solid #d7dde4;
        background: #f5f7f9;
        position: relative;
        border-radius: 4px;
        overflow: hidden;
    }

    .layout-logo {
        width: 100px;
        height: 30px;
        background: #5b6270;
        border-radius: 3px;
        float: left;
        position: relative;
        top: 15px;
        left: 20px;
    }

    .layout-nav {
        width: 420px;
        margin: 0 auto;
        margin-right: 20px;
    }

    a {
        color: #515A6E
    }

    .router-link-active {
        color: #2D8CF0
    }
</style>